package com.hk.web.core.init;

import com.hk.area.service.ChAreaService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

//启动加载项
@Component
@Order(4)
public class DataInitRunner implements ApplicationRunner {
    private static final Logger LOGGER = LoggerFactory.getLogger(DataInitRunner.class);

    @Resource
    private ChAreaService chAreaService;

    @Override
    public void run(ApplicationArguments args) {
        LOGGER.info("-----启动加载数据-----");
        chAreaService.initAreas();
        LOGGER.info("-----启动加载数据结束-----");


    }
}
